<%@ page language="java" import="java.util.*,com.hs.core.cache.*,com.hs.dnms.model.*,com.hs.auth.*,com.hs.auth.model.*" pageEncoding="utf-8"%>
 <%
  List  tablist = (List)request.getAttribute("tabdata"); 
  System.out.print(tablist);
  String  imgdata = (String)request.getAttribute("imgdata");  
  String  yeardata = (String)request.getAttribute("yearstr");  
  String  diseaseclass = (String)request.getAttribute("diseaseclass"); 
  String  dysnasty = (String)request.getAttribute("dysnasty");  
   HsAccount accInfo = (HsAccount)request.getSession().getAttribute(AUTHConstant.USERINSESSION);
	String lang = accInfo.getCreatuser() + "";
		  String  allinfo = (String)request.getAttribute("allinfo");  
	
  %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<%@ include file="../../include.jsp"%> 
<script language="javascript" type="text/javascript" src="<%=path %>/thirtpart/My97DatePicker/WdatePicker.js"></script>
<script src="<%=basePath %>app/javascripts/transform.js"></script>
  
<script language="javascript" type="text/javascript" src="<%=path %>/thirtpart/highcharts216/highcharts.js"></script>
<script language="javascript" type="text/javascript" src="<%=path %>/thirtpart/highcharts216/modules/exporting.js"></script>
<script language="javascript" type="text/javascript">
   function staticDetail(detailname,countsql){
 	var pageURL = "<%=basePath%>static/staticdetail.do?countsql="+encodeURIComponent(countsql) + "&detailname=" + encodeURIComponent(detailname); 
	openwindow(pageURL,'1000','800','题录统计详细数据'); 
 }
  function s2t()
{
	document.body.innerHTML = document.body.innerHTML.s2t();
}
function t2s()
{
	document.body.innerHTML = document.body.innerHTML.t2s();
}
</script>
</head>
<body>
<form name="searchform" action="<%=basePath %>statics/prestat.do" method=post>
    <table width="100%" border="0" cellspacing="0" cellpadding="0" class="deta_list_sear">
      <tr>
        <td width="15%">
          疾病分类：
        </td>
        <td width="20%">
           <input type="text" id="diseaseclass" value="<%=diseaseclass==null?"":diseaseclass %>" class="sear_input" name="diseaseclass"  />
        </td>  
        <td width="15%">
          朝代：
        </td>
         <td width="20%">
           <input type="text" id="dysnasty" value="<%=dysnasty==null?"":dysnasty %>" class="sear_input" name="dysnasty" />
         </td>
         <td width="10%" align="left">
            <input  type="submit" value="统计" class="but_2"/>
        </td>
         <td width="5%" align="right">
            <input  type="button" value="简体" onclick="t2s();" class="but_2"/>
        </td>
         <td width="5%" align="left">
            <input  type="button" value="繁体" onclick="s2t();" class="but_2"/>
        </td>
         <td width="10%" align="left">
            &nbsp;
        </td>
        </tr>
    </table>
</form>
<table width="100%" border="0" cellspacing="0" cellpadding="0" class="list">
<tr style="height:100%">
<td> 
	<table border="0" cellspacing="0" cellpadding="0" class="list" > 
      <tr>
        <th width="10%">序号</th>  
        <th width="50%">方剂名称</th>
        <th width="40%">古籍条目数</th> 
      </tr>   
      <%if(tablist != null && tablist.size()>0){  
      		for(int i = 0;i<tablist.size();i++){
      			Map data = (Map)tablist.get(i); 
      			String yearStr = (String)data.get("symname");
      			String yearcount = data.get("symcount") + ""; 
      %> 
      <tr>
        <td align="center"><%= i+1 %></td> 
        <td><%=yearStr %></td>
        <td><a href="javaScript:staticDetail('<%=yearStr %>','<%=data.get("countsql")+"" %>')"><%=yearcount%></a></td> 
       </tr>  
      <%}}else{ %>
      <tr>
        <td align="center" colspan="3"><font color="red">没有数据</font></td>
      </tr>
      <%} %>
    </table>
    </td> 
    </tr>
    <tr>
    <td >
    	<div id="container" class="highcharts-container" style="height:100%; margin: 0 2em; clear:both; min-width: 300px">
    
    </td>
 </tr>  
 </table>
</body>
</html>
<script language="javascript" type="text/javascript">


var chart;
$(document).ready(function() {
   chart = new Highcharts.Chart({
      chart: {
         renderTo: 'container',
         defaultSeriesType: 'line'
      },
      title: {
         text: '<strong><font color=red size=3>多囊卵巢综合征排名前十的方剂数量各朝代趋势统计图</font></strong>'
      },
      subtitle: {
         text: '<strong><%=allinfo%></strong>'
      },
      xAxis: {
         categories: <%=yeardata%>
      },
      yAxis: {
         title: {
            text: '<strong>文献数量（篇）</strong>'
         }
      },
      tooltip: {
         enabled: false,
         formatter: function() {
            return '&lt;b&gt;'+ this.series.name +'&lt;/b&gt;&lt;br/&gt;'+
               this.x +': '+ this.y +'&Acirc;&deg;C';
         }
      },
      plotOptions: {
         line: {
            dataLabels: {
               enabled: true
            },
            enableMouseTracking: false
         }
      },
      exporting: {
		
		filename: "chart",
		
		type: "image/png",
		
		url: '<%=basePath%>image/export.do',
		
		width: 800
		
		},
      series: [<%=imgdata%>]
   });
   
   
});

function fonttransfer(){
  	var fonttype = <%=lang%>;
  	if(fonttype == "2"){
  		document.body.innerHTML = document.body.innerHTML.s2t();
  	}else {
  		document.body.innerHTML = document.body.innerHTML.t2s();
  	} 
}
setTimeout("fonttransfer()",3000);
</script>
